<?php
/**
 * @link https://www.kancloud.cn/cleverstone/ymb2
 * @copyright Copyright (c) 2020 Yii Manager Software LLC
 */

use builder\helper\H5;
use builder\base\BaseBundle;
use builder\helper\App;

BaseBundle::register($this);

/** @var \yii\web\View $this view组件实例 */
/** @var string $content 主体内容 */
/** @var string $uiTheme UI主题 */

$uiTheme = $this->params['uiTheme'];
$themeColor = $this->params['themeColor'];
$menuLayout = $this->params['menuLayout'];
?>
<?php $this->beginPage() ?>
    <!DOCTYPE html>
    <html lang="<?= Yii::$app->language ?>" class="h-100" data-menu-layout="<?= $menuLayout ?>">
    <head>
        <meta charset="<?= Yii::$app->charset ?>">
        <meta name="viewport" content="initial-scale=1.0, width=device-width, shrink-to-fit=no">
        <?php $this->registerCsrfMetaTags() ?>
        <?= H5::registerBackendMetaTags() ?>
        <title><?= H5::encode($this->title) ?></title>
        <?= H5::registerPWA_Manifest() ?>
        <?php $this->head() ?>

        <!--Brand-->
        <script>
            !function () {
                let pad_char = function (count, char) {
                    let str = '';
                    for (let i = 0; i < count; i++) str += char;
                    return str;
                };
                let $topLeftAngle = '╔';
                let $topRightAngle = '╗';
                let $bottomLeftAngle = '╚';
                let $bottomRightAngle = '╝';
                let $rowChar = '═';
                let $colChar = '║';
                let $space = '\u0020';
                let $crlf = '\r\n';
                let $brandName = 'Yii Manager 2.0';
                let $breakPoint = '%c';
                let $message = '';
                $message += $breakPoint + $topLeftAngle + pad_char(26, $rowChar) + $topRightAngle + $crlf;
                $message += $colChar + pad_char(3, $space) + $breakPoint + $brandName + $breakPoint + pad_char(3, $space) + $colChar + $crlf;
                $message += $colChar + pad_char(26, $space) + $colChar + $crlf;
                $message += $colChar + pad_char(2, $space) + '天之道，损有余而补不足' + pad_char(4, $space) + $colChar + $crlf;
                $message += $bottomLeftAngle + pad_char(26, $rowChar) + $bottomRightAngle;
                let $style1 = 'color:#d1d2d3;font-weight:700;font-size:12px;font-family:mono,consolas;';
                let $style2 = 'color:#00b6bf;font-weight:700;font-size:16px;font-family:mono,consolas;';
                let $style3 = 'color:#e0e1e2;font-weight:700;font-size:12px;font-family:mono,consolas;';

                console.log($message, $style1, $style2, $style3);
            }();
        </script>
        <!--watermark-->
        <style>
            .ym-watermark {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background-repeat: repeat;
                pointer-events: none;
                z-index: 20240525;
                background-size: 500px;
                background-position: 75px 150px, -25px -75px;
                background-image: /**浅色*/ url(''),
             /**深色*/  url('');
            }
        </style>
        <!--css变量-->
        <style>
            :root {
                --primary-color: <?= $themeColor ?>;
            }
        </style>
    </head>

    <body class="<?= $uiTheme ?> d-flex flex-column h-100 min-width1250" ng-cloak ng-app="ym2.app">
    <?php $this->beginBody() ?>

    <!--水印-->
    <div class="ym-watermark"></div>

    <!--头部导航-->
    <?= App::nav() ?>

    <!--侧边菜单-->
    <?= App::menu([
        'asideExpanded' => !empty($this->params['asideExpanded']),
    ]) ?>

    <!--内容主体-->
    <main role="main" class="ym2-main-content pl-180 flex-grow-1 pb-25 layui-row">
        <!-- 背景装饰 -->
        <div class="background-decoration"></div>
        <?= $content ?>
    </main>

    <!--尾部导航-->
    <footer class="ym2-bottom-footer pl-180 text-muted ym2-footer position-fixed fixed-bottom">
        <p class="float-left pl-3 f12 py-1">
            <span class="layui-font-gray">&copy;2017-<?= date('Y') ?></span>
            <a style="text-decoration: underline" class="text-monospace" target="_blank" href="<?= App::params('other.technicalSupport') ?>">
                <?= H5::encode(App::params('other.app.name')) ?>
            </a>
        </p>
    </footer>

    <?php $this->endBody() ?>
    </body>
    </html>
<?php $this->endPage();
